
package com.jf.cloud.order.mapper;

import com.jf.cloud.common.database.util.PageAdapter;
import com.jf.cloud.order.bo.mongo.MongoPurchaseOrderBO;
import com.jf.cloud.order.dto.PurchaseOrderDTO;
import com.jf.cloud.order.model.PurchaseOrder;
import com.jf.cloud.order.vo.PurchaseOrderExcelVO;
import com.jf.cloud.order.vo.PurchaseOrderVO;
import com.jf.cloud.order.vo.UnDeliveryPurchaseOrderExcelVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 采购订单
 *
 * @author zz
 * @date 2022-06-22 17:12:02
 */
public interface PurchaseOrderMapper {

    /**
     * 获取采购订单列表
     *
     * @return 采购订单列表
     */
    List<PurchaseOrder> list();

    /**
     * 根据id获取采购订单列表
     * @param purchaseOrderIds 采购订单id
     * @return 采购订单列表
     */
    List<PurchaseOrderVO> listByPurchaseOrderIds(@Param("purchaseOrderIds") List<Long> purchaseOrderIds);

    /**
     * 根据采购订单id获取采购订单
     *
     * @param purchaseOrderId 采购订单id
     * @return 采购订单
     */
    PurchaseOrder getByPurchaseOrderId(@Param("purchaseOrderId") Long purchaseOrderId);

    /**
     * 保存采购订单
     *
     * @param purchaseOrder 采购订单
     */
    void save(@Param("purchaseOrder") PurchaseOrder purchaseOrder);

    /**
     * 更新采购订单
     *
     * @param purchaseOrder 采购订单
     */
    void updateByPurchaseId(@Param("purchaseOrder") PurchaseOrder purchaseOrder);

    /**
     * 采购订单信息
     *
     * @param purchaseOrderId 采购订单号
     * @param supplierId
     * @return
     */
    PurchaseOrderVO info(@Param("purchaseOrderId") Long purchaseOrderId, @Param("supplierId") Long supplierId, @Param("lang") Integer lang);

    /**
     * 分页
     *
     * @param pageAdapter
     * @param purchaseOrderDTO
     * @param supplierIds
     * @param shopIds
     * @return
     */
    List<PurchaseOrderVO> pagePurchaseOrder(@Param("pageAdapter") PageAdapter pageAdapter, @Param("purchaseOrder") PurchaseOrderDTO purchaseOrderDTO, @Param("supplierIds") List<Long> supplierIds, @Param("shopIds") List<Long> shopIds);

    /**
     * 获取
     *
     * @param purchaseOrderDTO
     * @param supplierIds
     * @param shopIds
     * @return
     */
    List<UnDeliveryPurchaseOrderExcelVO> listUnDeliveryPurchaseOrder(@Param("purchaseOrder") PurchaseOrderDTO purchaseOrderDTO, @Param("supplierIds") List<Long> supplierIds, @Param("shopIds") List<Long> shopIds);

    /**
     * 分页
     *
     * @param purchaseOrderDTO
     * @param supplierIds
     * @param shopIds
     * @return
     */
    List<PurchaseOrderExcelVO> listPurchaseOrderDetail(@Param("purchaseOrder") PurchaseOrderDTO purchaseOrderDTO, @Param("supplierIds") List<Long> supplierIds, @Param("shopIds") List<Long> shopIds);

    /**
     * 获取筛选后的数量
     *
     * @param purchaseOrderDTO
     * @param supplierIds
     * @param shopIds
     * @return
     */
    Long count(@Param("purchaseOrder") PurchaseOrderDTO purchaseOrderDTO, @Param("supplierIds") List<Long> supplierIds, @Param("shopIds") List<Long> shopIds);

    /**
     * 获取采购订单及订单项的信息
     *
     * @param purchaseOrderId 采购订单id
     * @return 采购订单信息
     */
    MongoPurchaseOrderBO getMongoPruchaseOrderInfo(@Param("purchaseOrderId") Long purchaseOrderId);
}
